package com.ysd.lis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ysd.common.dto.DeletesDto;
import com.ysd.lis.dto.SysInterfaceMethodOutparamList;
import com.ysd.lis.entity.SysInterfaceDictParam;
import com.ysd.lis.entity.SysInterfaceMethodOutparam;
import com.ysd.lis.mapper.SysInterfaceDictParamMapper;
import com.ysd.lis.service.SysInterfaceMethodOutparamService;
import com.ysd.lis.mapper.SysInterfaceMethodOutparamMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【SYS_INTERFACE_METHOD_OUTPARAM(接口方法明细)】的数据库操作Service实现
* @createDate 2024-04-26 10:52:58
*/
@Service
public class SysInterfaceMethodOutparamServiceImpl extends ServiceImpl<SysInterfaceMethodOutparamMapper, SysInterfaceMethodOutparam>
    implements SysInterfaceMethodOutparamService{

    @Autowired
    SysInterfaceDictParamMapper sysInterfaceDictParamMapper;
    @Autowired
    SysInterfaceMethodOutparamMapper sysInterfaceMethodOutparamMapper;


    @Override
    public List<SysInterfaceDictParam> getOutParamList(String dictId) {
        LambdaQueryWrapper<SysInterfaceDictParam> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(SysInterfaceDictParam::getDictId,dictId).eq(SysInterfaceDictParam::getType,2).eq(SysInterfaceDictParam::getState,1);
        return sysInterfaceDictParamMapper.selectList(lambdaQueryWrapper);
    }

    @Override
    public List<SysInterfaceMethodOutparam> getInterfaceMethodOutparamList(String methodId) {
        return sysInterfaceMethodOutparamMapper.selectList(new LambdaQueryWrapper<SysInterfaceMethodOutparam>().eq(SysInterfaceMethodOutparam::getMethodId,methodId));
    }

    @Override
    public boolean updateInterfaceMethodOutparam(SysInterfaceMethodOutparamList sysInterfaceMethodOutparamList) {
        return this.saveOrUpdateBatch(sysInterfaceMethodOutparamList.getDatas());
    }


    @Override
    public boolean deleteInterfaceMethodOutparam(DeletesDto deletesDto) {
        return this.removeByIds(deletesDto.getIds());
    }
}




